try_call_result

Type representing the result of a function call that may have thrown a require exception.

Constructed by calling try_call_catch(). Contains either a value of type T or error information.

Use is_error to check if the call failed, value to get the value (if the call succeeded), value_or_null to get the value or null (if the call failed), or require_message_or_null to get the error message (if the call failed) or null (if the call succeeded).

Since

0.14.16

Properties

Link copied to clipboard

Check if this result represents an error.

Link copied to clipboard

Get the error message from the require exception that was thrown by the function call, or null if the function call did not throw an exception.

Link copied to clipboard
val value: T

Get the value contained in this result.

Link copied to clipboard

Get the value contained in this result or null if this result represents an error.